<tagLib name="html" />
{$header}
<div id="main" class="main" >
<!-- 主体内容  -->
<div class="content" >
  
<!--  功能组区域  -->
<div class="btn-toolbar">
      <div class="btn-group">
  	<button class="btn btn-primary" onclick="add()"><i class="icon-plus icon-white"></i> 新增</button>
    <button class="btn btn-primary" onclick="fastadd()"><i class="icon-edit icon-white"></i> 导入采购</button>
    </div>
    <form class="search-form pull-right" method='post' action="__URL__">
              供应商{:modList('Supplier',$_REQUEST['supplier_id'] )}
              <input type="text" class="search-query span4" name="keywords" <notempty name='_REQUEST.keywords'>
                    <php>echo 'value="'.urldecode($_REQUEST['keywords']).'"'</php><else/>
                    placeholder="按产品名称，条码，入库单号搜索"
                </notempty>
                >
                <input type="submit" class="btn btn-primary" value="搜索">
          </form>
          
  
  </div>
<!-- 功能组区域结束 -->
<php>
    function detail($id){
    echo ('<a href="__APP__/Buy_detail/index/buy_id/'.$id.'">采购明细</a>');
    }
</php>
<!-- 列表显示区域  -->
<div class="list" >
<div id="result" class="result none"></div><html:list id="checkList" style="table table-bordered table-striped" name="action" checkbox="true" action="true" datasource="list" show="id:编号|5%:edit,buy_no:采购单号,total:采购总金额,sum_number:总数量,receive_total:实收总金额,receive_sum_number:实收总数量,supplier_id|getModelName=Supplier:供应商,create_time|toDate:采购时间,id|detail:采购明细" actionlist="edit:详情:id,addpt:增录产品:id" />
</div>
<!--  分页显示区域 -->
<div class="page">{$page}</div>
<!-- 列表显示区域结束 -->
</div>
<!-- 主体内容结束 -->
</div>
<!-- 主页面结束 --><include file="Public:footer"/>
<script type="text/javascript">
  function fastadd(){
    location.href=URL+"/fastadd";
  }

//增录产品
  function addpt(id){
    location.href=APP+"/Buy_detail/add/id/"+id;
  }

  function quicksale(id){
    var keyValue;
    if (id)
    {
      keyValue = id;
    }else {
      keyValue = getSelectCheckboxValues();
    }
    if (!keyValue)
    {
      alert('请选择入库单！');
      return false;
    }
    location.href=APP+"/Sale/fastadd/enter_id/"+keyValue;
  }
</script>

